//
//  YGHospitalDetailsView.m
//  yuanshangyiliao
//
//  Created by icholab on 2021/3/30.
//

#import "YGHospitalDetailsView.h"
#import "YGBannerMsgView.h"
#import "YGHomeBLL.h"

@interface YGHospitalDetailsView ()
@property(nonatomic,strong)YGBannerMsgView *bannerMsgView;
@property(nonatomic,strong)UIScrollView *hospitalIntroduceView;
@property (nonatomic, strong) YGHospitalDetailModel *model;





@end
@implementation YGHospitalDetailsView

#pragma private

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self initView];
        [self initcontraints];
        [self requestData];
    }
    return self;
}

-(void)initView{
    [self addSubview:_bannerMsgView];
    [self addSubview:_hospitalIntroduceView];
}

-(void)initcontraints{
    [self.bannerMsgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.right.mas_equalTo(self.mas_top);
            make.height.mas_equalTo(130);
    }];
    [self.hospitalIntroduceView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.mas_equalTo(10);
            make.right.mas_equalTo(-10);
            make.height.mas_equalTo(self.mas_height);
    }];
    
}

//请求医院详情数据
-(void)requestData{
    WeakSelf(self);
    [YGHomeBLL requestHospitalDetailInfoSuccess:^(YGHospitalDetailModel * _Nonnull model) {
        weakself.model=model;
    } fail:^(NSError * _Nonnull error) {
        
    }];
    
}

#pragma setter
- (UIView *)bannerMsgView{
    if (!_bannerMsgView) {
        _bannerMsgView= [[YGBannerMsgView alloc] init];
        _bannerMsgView.backgroundColor=UIColorFromRGB(0x37C8D7);
        
        
    }
    return _bannerMsgView;
}

- (UIScrollView *)hospitalIntroduceView{
    if (!_hospitalIntroduceView) {
        _hospitalIntroduceView= [[UIScrollView alloc] init];
        
    }
    return _hospitalIntroduceView;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
